package com.acc.service.impl;

import java.io.IOException;
import java.sql.SQLException;

import com.acc.dao.UserDao;
import com.acc.dao.impl.UserDaoImpl;
import com.acc.entity.User;
import com.acc.service.UserService;


/**
 * 
 * @author 姜伟康
 *2017-9-15
 */
public class UserServiceImpl implements UserService {

	UserDao userDao = new UserDaoImpl();
	
	boolean result = false ;

	/**
	 * 根据用户ID查询用户
	 * @param orderId
	 * @throws IOException
	 * @throws SQLException
	 */
	@Override
	public User selectUserById(Integer userId) {
		// TODO Auto-generated method stub
		
		User  user = userDao.selectUserById(userId);
		
	
		return user;
	}

	
	
	/**
	 * 修改用户信息
	 * @param user 用户信息
	 * @throws IOException
	 * @throws SQLException
	 */
	@Override
	public boolean updateUser(User user) {
		// TODO Auto-generated method stub
 
		int number = userDao.updateUser(user);
		
		if (number!=0) {
		    	result = true ;
		}
		
 		return result ;
	}

}
